home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_bas
/
pbc32.zip
/
PBC$BAS.ZIP
/
FREADLIN.BAS
< prev
next >
Wrap
BASIC Source File
|
1996-04-10
|
1KB
|
41 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone (C) Copyright 1996 Charon Software, All Rights Reserved |
' | |
' +----------------------------------------------------------------------+
DECLARE FUNCTION FGetLoc2& (BYVAL FileHandle%)
DECLARE SUB FSetLoc (BYVAL FileHandle%, Posn&)
DECLARE SUB SFRead (BYVAL FileHandle%, St$, BytesRead%, ErrCode%)
SUB FReadLine (FileHandle%, Dest$, DLen%, TooLong%, ErrCode%)
Posn& = FGetLoc2&(FileHandle%)
Buffer$ = SPACE$(LEN(Dest$) + 2)
SFRead FileHandle%, Buffer$, BytesRead%, ErrCode%
IF ErrCode% <= 0 THEN
IF ErrCode% < 0 AND BytesRead% > 0 THEN ErrCode% = 0
Buffer$ = LEFT$(Buffer$, BytesRead%)
tmp% = INSTR(Buffer$, CHR$(13) + CHR$(10))
IF tmp% THEN
DLen% = tmp% - 1
Adjustment% = DLen% + 2
ELSE
DLen% = LEN(Buffer$)
Adjustment% = DLen%
END IF
LSET Dest$ = Buffer$
IF DLen% > LEN(Dest$) THEN
TooLong% = -1
DLen% = LEN(Dest$)
Adjustment% = DLen%
ELSE
TooLong% = 0
END IF
Posn& = Posn& + CLNG(Adjustment%)
FSetLoc FileHandle%, Posn&
ELSE
DLen% = 0
TooLong% = 0
END IF
END SUB